package com.xhwy.enums;

public enum ProductState {
    //1.提供当前枚举类的对象，多个对象之间用“，”隔开，末尾对象“；”结束
    NORMAL(0, "正常状态"),
    SELLDOWN(1, "下架状态");

    //2.声明枚举类的属性：private final修饰
    private final Integer stateCode;
    private final String stateDesc;

    //3.私有化类构造器
    private ProductState(Integer stateCode, String stateDesc){
        this.stateCode = stateCode;
        this.stateDesc = stateDesc;
    }

    public Integer getStateCode() {
        return stateCode;
    }

    public String getStateDesc() {
        return stateDesc;
    }

    @Override
    public String toString() {
        return "ProductState{" +
                "stateCode=" + stateCode +
                ", stateDesc='" + stateDesc + '\'' +
                '}';
    }
}
